Repository navigation
simd(avx2): fix F64x8::reduce_min/max regression from #435 + before/after disassembly write-up - #437
Merged
Merged
Conversation
Adds section 7 to the wide/pulp comparison and a blackboard entry. AVX-512: all 30 probe symbols are identical before and after. AVX2: LLVM had already vectorized master's lane loops, so most of the F2 rewrite is neutral; the compares are 3 instructions longer; F64x8::reduce_min/max regressed 1.9x; real gains are U8x64::mask_blend (10x), F32x16 compare+select (2.4x) and F32x16 reductions (1.6x). Docs only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMQaYXab73XQdjqZfAW
…_max PR #435 replaced it with a hand-written NaN-ignoring vminpd/vblendvpd tree through the 256-bit halves, which the before/after probe showed to be 1.9x slower (2.15 -> 4.03 ns per call, 21 -> 27 instructions). The original body, an iterator fold over the fixed-size lane array (the shape simd_ops is built on), lowers to a short vminsd chain. Results are bit-identical either way. Verified: probe back to ~2.0 ns and 21 instructions, result fingerprint unchanged; tests/simd_lane_masks (incl. the NaN compatibility tests) and simd_float_classify pass on v3 and avx; lib 2692 passed on v3; masking-parity with the IEEE digest passes on pinned v3 and avx-qemu; clippy, fmt, guard and the ternlog generator check clean. AVX-512 code is untouched. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMQaYXab73XQdjqZfAW
… the fix Section 8 of the wide/pulp comparison and a blackboard entry: the ndarray and wide8 inner loops are instruction-identical on x86-64-v4; the gap was a per-lane saturating float-to-int cast in the arm. With an exact 2^52 add and to_bits() the arm is level with wide and pulp on AVX-512. Docs only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMQaYXab73XQdjqZfAW
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AdaWorldAPI
marked this pull request as ready for review
November 17, 2026 18:41
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These three commits were pushed after #436 had already been merged, so they did not reach
master. The updated description on #436 mentioned them, but only the Mandelbrot table (§ 6) was merged.Code (
src/simd_avx2.rs, one method pair)F64x8::reduce_min/reduce_maxreturn to master's original body: an iterator fold over the fixed-size lane array, which is the shapesimd_opsis built on.vminpd/vblendvpdtree. The before/after probe showed the tree to be 1.9× slower: 2.15 → 4.03 ns per call, and 21 → 27 instructions.Docs (
.claude/knowledge/simd-crate-comparison-wide-pulp-2026-11-17.md§§ 7–8, blackboard)§ 7: #435 before and after, per method (
llvm-objdumpplus timing)U8x64::mask_blend(10×),F32x16compare + select (2.4×) and theF32x16reductions (1.6×).§ 8: Mandelbrot follow-up
2^52add andto_bits(), ndarray takes 149–154 ms, against 152–157 ms for wide8 and 155–156 ms for pulp.select.Verification
tests/simd_lane_masks(including the NaN compatibility tests) andsimd_float_classifypass on v3 and avx.-D warnings, fmt, the facet-stride guard and the ternlog generator check are all clean.Generated by Claude Code